﻿using J.Status.Application.Command.RoomTypeCommand;
using J.StatusModel;
using MediatR;
using StatusService;

namespace J.Status.Application.Handler.RoomTypeHandler
{
    public class RoomTypeAllHandler : IRequestHandler<RoomTypeAllCommand, List<RoomTypeModel>>
    {
        private readonly IRoomTypeService roomTypeService;

        public RoomTypeAllHandler(IRoomTypeService roomTypeService)
        {
            this.roomTypeService = roomTypeService;
        }

        public async Task<List<RoomTypeModel>> Handle(RoomTypeAllCommand request, CancellationToken cancellationToken)
        {
            return await roomTypeService.GetAllRoomType();
        }
    }
}
